package com.shhm.common.entity.system;

import com.shhm.common.entity.admin.SysUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @author JackZ
 * @version 1.0
 * @description: 用户信息
 * @date 2025/7/25 下午2:20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysUserDetail implements UserDetails {
    SysUser sysUser;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return List.of();
    }

    @Override
    public String getPassword() {
        return sysUser.getPassword();
    }

    @Override
    public String getUsername() {
        return sysUser.getUsername();
    }
}
